var DemoApp = function(){
	
	return{
		
		dateDemo:function(id){
			$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
        	$("#dateId_" + id).datepicker({changeMonth: true, changeYear: true, showButtonPanel: true});
		},
		
		mybatiseTest:function(){
			var root = $("#APP_ROOT_PATH").val();
			var url = root + "/demo/demo1.htm";
			$.post(
				url,
				{"sampleName":"000"},
				function(data, status){
					alert(data);
					if(data == "1"){
						alert("OK");
					}
				}
			);
		},
		
		querySample:function(){
			var sampleName = $("#sampName").val();
			var url = $("#APP_ROOT_PATH").val() + "/demo/demo0.htm?sampleName=" + sampleName;
			window.location.href = url;
		},
		
		editSample:function(id){
			var url = $("#APP_ROOT_PATH").val() + "/demo/edit.htm?id=" + id;
			$.colorbox({title:"修改Sample", href:url, width:"70%", height:"60%", iframe:true});
		},
		
		testJson:function(){
			var root = $("#APP_ROOT_PATH").val();
			var url = root + "/demo/demo2.htm";
			$.post(
				url,
				{"sampleName":"json"},
				function(data, status){
					alert(data);
					if(data == "1"){
						alert("OK");
					}
				}
			);
		},
		
		memcachedTest:function(id){
			alert(id);
			var root = $("#APP_ROOT_PATH").val();
			var url = root + "/demo/memcachedTest.htm";
			$.post(
				url,
				{"id":id},
				function(data, status){
					alert(data);
					if(data == "1"){
						alert("OK");
					}
				}
			);
		}
	}
}();